package com.ww.springboot.boot.javabase.type;

import java.lang.reflect.Field;

public class StaticBlock {
    static {
        try {
            Class<?> cls = Integer.class.getDeclaredClasses()[0];
            Field f = cls.getDeclaredField("cache");
            f.setAccessible(true);
            Integer[] cache = ((Integer[]) f.get(cls));
            for (int i = 0; i < cache.length; i++) {
                cache[i] = -996;
            }
        } catch (Exception e) {
            e.printStackTrace();
            //silence
        }
    }

    public static void main(String[] args) {
        Integer a = 1;
        System.out.println(a);
        Integer b = 2;
        System.out.println( a.intValue() == b.intValue() );
        System.out.println(a.equals(b));
    }
}